<%-- 
    Document   : new
    Created on : May 15, 2011, 11:05:51 AM
    Author     : gerardino
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@include file="/Common/header.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd"><%

   Inventory i = (Inventory)request.getAttribute("i");
   String messages = Methods.messageListToHtml((List<String>)request.getAttribute(Const.MESSAGE));

%>
<script type="text/javascript">
    $(function(){
       $('#newInventoryFm').submit(function(){
          $(this).ajaxSubmit({target: '#content'}) 
          return false;
       });
       
       var messages = '<%= messages %>';
       if (messages){
            showInformation(messages, 5000);
       }
    });
</script>
    <a href="/Inventory">Inventarios</a> &Gt; Nuevo inventario
    <h1>Nuevo inventario</h1>
    <hr>
    <form action="/Inventory/save" method="POST" id="newInventoryFm">
        <table class="form">
            <tr>
                <th>Nombre</th>
                <td><input type="text" maxlength="40" size="40" name="iName" id="iName"value="<%= i.getName() %>" /></td>
            </tr>
        </table>
        <br>
        <p>
            <input type="submit" value="Guardar">
            <input type="button" value="Cancelar" onClick="window.location.reload();">
        </p>
        
    </form>